import { Router } from 'express';
import { AdminController } from '../controllers/admin.controller';
import { authMiddleware } from '../middlewares/auth';

const router = Router();
const adminController = new AdminController();

// 所有管理员路由都需要认证
router.use(authMiddleware);

// 设置超级管理员
router.post('/set-admin', adminController.setAdmin);

// 获取用户权限
router.get('/permissions/:userId', adminController.getUserPermissions);

// 获取用户角色
router.get('/roles/:userId', adminController.getUserRoles);

// 分配角色
router.post('/assign-role', adminController.assignRole);

// 移除角色
router.post('/remove-role', adminController.removeRole);

// 创建角色
router.post('/roles', adminController.createRole);

export default router; 